<%-- 
    Document   : index
    Created on : Oct 3, 2012, 6:19:50 PM
    Author     : DatPLT
--%>
<%@page import="BLO.ProductBLO"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/style.css"/>
        <script type="text/javascript" src="jquery/jquery-1.8.2.min.js"></script>
        <title>Home Page</title>
        <SCRIPT>

            var regObj ="<books></books>";
            var xmlDOM = new ActiveXObject("Microsoft.XMLDOM");
            function addToCart(productId){
                xmlDOM.async = false;
                xmlDOM.loadXML(regObj);
                if(xmlDOM.parseError.errorCode !=0 ){
                    alert("Error: "+xmlDOM.parseError.reason+"=="+regObj);
                }else{
                    newel=xmlDOM.createElement("edition");

                    x=xmlDOM.getElementsByTagName("book")[0];
                    x.appendChild(newel);
                }
                $('html, body').animate({ scrollTop: 0 }, 'slow');
            }
            
        </SCRIPT>
    </head>
    <body>
        <div class="divMain">
            <%@include file="header.jsp" %>
            <div class="divBody">
                <c:import url="WEB-INF/products.xml" var="xmldoc"/>
                <c:import url="xsl/products.xsl" var="xsldoc"/>
                <div class="divProducts">
                    <x:transform xml="${xmldoc}" xslt="${xsldoc}" />
                </div>
            </div>
            <div class="divFooter">
                <form name="myForm">
                    <input type="text" name="txtSearch"/>
                    <input type="button" value="Search" onclick="traversalDOMTree('WEB-INF/library.xml','dataTable')"/>
                </form>
                <table border="1" id="dataTable">
                    <tr>
                        <th>No.</th>
                        <th>Code</th>
                        <th>Title</th>
                        <th>Author</th>
                        <th>Price</th>
                    </tr>
                </table>

            </div>
        </div>
    </body>
</html>
